1. Field of the Invention
The present invention relates to a method for mixing a foreground picture and a background picture, a resolution of the foreground picture differing from a corresponding resolution of the background picture, the method comprising designating parts of the foreground picture as being transparent, and replacing transparent parts of the foreground picture by underlying parts of the background picture, the foreground picture and the background picture being converted to a common target resolution.
2. Description of the Related Art
Such a method is widely used in display systems which are suited for presenting a mixture of graphics and video signals on a display screen. An example of such a system is disclosed in U.S. Pat. No. 5,621,428. Normally, one of the signals is designated as a foreground signal, which causes a picture corresponding to the foreground signal to hide other pictures corresponding to the other signals at locations where the pictures mutually overlap. Parts of the foreground picture, of which the color complies with a predetermined color key, appear as transparent parts on the display screen, thus showing underlying parts of other pictures. In general, the respective spatial resolutions of the graphics and video signals are mutually different, either horizontally, vertically or in both directions. In those cases, the signals have to be scaled to a common resolution.
A disadvantage of known methods for mixing signals of different spatial resolutions using color keying, is that the scaling causes the color key to blend with colors of neighboring parts of the foreground image, yielding visible artifacts at the edges of transparent parts of the foreground image.
An objective of the present invention is to provide a method for mixing signals of different spatial resolutions using color keying in which said artifacts are avoided. To that end, the method according to the invention is characterized in that the replacement of transparent parts of the foreground picture by underlying parts of the background picture is effectively accomplished at an intermediate resolution, which is different from the target resolution, and which substantially equals the least common multiple of the resolution of the foreground picture and the corresponding resolution of the background picture.
By mixing the foreground picture and the background picture at the intermediate resolution, no averaging of pixels needs to take place, so there is no blending of the color key with colors of neighboring parts.
A method according to the invention actually scales the foreground picture and the background picture to the intermediate resolution by replicating pixels, respectively, by the denominator and the numerator of a fraction which represents or approximates the proportion between the resolution of the foreground picture and the resolution of the background picture. By replicating the pixels by a whole number, no blending of the color key takes place. At the intermediate resolution, pixels of the foreground picture and the background picture can be processed two by two. If a foreground pixel is opaque, the corresponding background pixel is ignored. If a foreground pixel is transparent, it is replaced by the corresponding background pixel. After mixing both pictures, the result picture is scaled to the target resolution.
The invention also relates to a display apparatus, embodying the above method according to the invention.
A further method according to the invention predicts the effect of actually mixing the pictures at the intermediate resolution by constructing a table of coefficients in advance. Instead of actually scaling the foreground picture and the background picture to the intermediate resolution, pixels from the background picture are combined one at a time with a number of pixels from the foreground picture in a way which is prescribed by the coefficients contained in a table entry. Each time an output pixel has been produced, a next table entry is selected as the source of the coefficients. Initially the first entry is selected, and after the last entry, the process proceeds cyclically by selecting the first entry again.
The invention also relates to a display apparatus, embodying this last-mentioned method according to an embodiment of the invention.